import * as types from './mutation_types'
import request from '../../../util/axios'

// 查询列表用户排序
export const getListSort = ({ commit }, tableId) => {
  commit(types.SORTLIST_SET_RETRIEVED, null)
  commit(types.SORTLIST_SET_LOADING, true)
  return request({
    url: `/yuyi-category-boot/api/metadata/user/sort/${tableId}`
  }).then((res) => {
    commit(types.SORTLIST_SET_RETRIEVED, res.data.data)
    commit(types.SORTLIST_SET_LOADING, false)
  }).catch(e => {
    commit(types.SORTLIST_SET_RETRIEVED, null)
    commit(types.SORTLIST_SET_LOADING, false)
  })
}
